# -*- coding: utf-8 -*-

"""
DateTime   : 2020/12/13 15:49
Author     : ZhangYafei
Description: 
"""
# 错误方式， 有坑，结果不是你想要的。
"""
user_list = ["刘德发", "范德彪", "刘华强", '刘尼古拉斯赵四', "宋小宝", "刘能"]
for item in user_list:  #
    print(item)
    if item.startswith("刘"):
        user_list.remove(item)  # 根据值删除  第一次循环 ["范德彪", "刘华强", '刘尼古拉斯赵四', "宋小宝", "刘能"]

print(user_list)
"""

user_list = ["刘得发", "范德彪", "刘华强", '刘尼古拉斯赵四', "宋小宝", "刘能"]
for index in range(len(user_list) - 1, -1, -1):
    print(index)
    item = user_list[index]
    if item.startswith("刘"):
        user_list.remove(item)
print(user_list)

